import 'package:XinXiZiXun/common/entitys/entitys.dart';
import 'package:XinXiZiXun/common/utils/utils.dart';

//用户登录
class UserLoginApi {
  static Future<UserLoginResponseEntity> login({
    // @required BuildContext context,
    Map<String, dynamic> params,
  }) async {
    var response = await HttpUtil.instance.post(
      'api/account/login',
      params: params,
    );

    print('数据---:${response}');

    return UserLoginResponseEntity.fromJson(response);
  }
}

//用户信息
class UserInfoApi {
  static Future<UserInfoEntity> userInfo({
    Map<String, dynamic> params,
  }) async {
    var response = await HttpUtil.instance.post(
      'api/account/get_info',
      params: params,
    );

    print('数据---:${response}');

    return UserInfoEntity.fromJson(response);
  }
}

//首页轮播图
class HomePageBannerApi {
  static Future<HomePageBannerEntity> homePageBanner({
    Map<String, dynamic> params,
  }) async {
    var response = await HttpUtil.instance.post(
      'api/common/get_banner_list',
      params: params,
    );

    print('数据---:${response}');

    return HomePageBannerEntity.fromJson(response);
  }
}
